Week 7: NullReferenceException

Andrii KudlaiAndrii Kudlai
2 min read

The main things in this article: setting up the main scripts, starting infinite, finishing the design

Finishing the design

This week the designs of all rooms and characters were approved, all files were distributed into folders and formatted in the right format for unity. In total we have already finished 2 stages of our development - script and design.

Setting up the main scripts

I as Producer made basic scripts, so that when building a project it was convenient to use only 1 script for basic things (like character walking). I also made animations, and things like tips manger + trigger or task manager + trigger. And also found a plugin that will help us to implement the design in the game without any fiddles

using UnityEngine;
using System;
using TMPro;

public class TipsManager : MonoBehaviour
{
    public static Action<string> displayTipEvent;
    public static Action disableTipEvent;

    [SerializeField] private TMP_Text messageText;

    private Animator animator;
    public int activeTips;

    private void Start()
    {
        animator = GetComponent<Animator>();
    }

    private void OnEnable()
    {
        displayTipEvent += displayTip;
        disableTipEvent += disableTip;
    }

    private void OnDisable()
    {
        displayTipEvent -= displayTip;
        disableTipEvent -= disableTip;
    }

    private void displayTip(string message)
    {
        messageText.text = message;
        activeTips++;
        animator.SetInteger("state", activeTips);
    }

    private void disableTip()
    {
        activeTips--;
        animator.SetInteger("state", activeTips);
    }
}

Example one of the basic scripts

tips and task managers in work

dialogue in work

starting infinite

I also joined the team for development, as we have little time left and a lot of work to do. Of course there are thoughts that we may not make it to the deadline, but still I made it a priority to learn something special than to abandon the project and make a quick game like mario, which I have seen in many other projects.
Examples of this week's completed room can also be seen above

Results of the week: Not much time, a lot of work. A lot of new information learnt on unity to give quality generic scripts to the team. Hope for success dies last

0
Subscribe to my newsletter

Read articles from Andrii Kudlai directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Andrii Kudlai
Andrii Kudlai