コード例 #1
0
    void Awake()
    {
        //Singletone
        if (ins == null)
        {
            ins = this; DontDestroyOnLoad(gameObject);
        }
        else
        {
            Destroy(gameObject);
        }

        if (lifeController == null)
        {
            lifeController = GetComponent <VisualLifeController>();
        }

        if (unitsManager == null)
        {
            unitsManager = GetComponent <UnitsManager>();
        }
    }
コード例 #2
0
    void Awake()
    {
        //Singletone
        if (ins == null) { ins = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); }

        if (lifeController==null)
        lifeController = GetComponent<VisualLifeController>();

        if (unitsManager == null)
            unitsManager = GetComponent<UnitsManager>();
    }