Beispiel #1
0
    public override void Ready()
    {
        Transform Prefab = null;

        switch (Type)
        {
        case EnmType.Enm01:
            Prefab = FloorManager.Instance.Enm01Prefab;
            break;
        }

        Transform tComponen = UnityEngine.Object.Instantiate(Prefab, new Vector3(X, Y, ZPos), Quaternion.identity) as Transform;

        tComponen.gameObject.name = Name;

        UnitControl unitCtl = tComponen.gameObject.GetComponent(typeof(UnitControl)) as UnitControl;

        // memo Stateにより表示状態を変更
        switch (State)
        {
        case EnmState.Hide:
            unitCtl.ReqChangeHide();
            break;

        case EnmState.Active:
            unitCtl.ReqChangeActive();
            break;
        }

        SetPanelEvent(Vector2I.InvalidPos, Vector2);

        base.Ready();
    }
Beispiel #2
0
    /// <summary>
    /// Panel変更通知受信
    /// </summary>
    void OnReportPanelChange(int X, int Y, PanelState PState)
    {
        if (this.X != X || this.Y != Y)
        {
            throw new Exception("Error");
        }

        if (State == EnmState.Hide && PState == PanelState.Open)
        {
            State = EnmState.Active;
            UnitControl uCtr = TaskControl as UnitControl;
            uCtr.ReqChangeActive();
        }
        else if (State == EnmState.Active && PState == PanelState.Close)
        {
            State = EnmState.Hide;
            UnitControl uCtr = TaskControl as UnitControl;
            uCtr.ReqChangeHide();
        }
    }