示例#1
0
 protected virtual void Awake()
 {
     render = GetComponent <MeshRenderer>();
     if (render == null)
     {
         render = GetComponentInChildren <MeshRenderer>();
     }
     if (render != null)
     {
         meshFilter     = render.GetComponent <MeshFilter>();
         originMaterial = render.sharedMaterial;
     }
     elementComponent = GetComponent <CElementComponent>();
 }
示例#2
0
    virtual protected void Awake()
    {
        //注册事件
        GameManager.instance.eRoundStart.AddListener(OnRoundStart);
        GameManager.instance.eRoundEnd.AddListener(OnRoundEnd);
        GameManager.instance.eGameStart.AddListener(OnGameStart);
        GameManager.instance.eGameEnd.AddListener(OnGameEnd);
        render = GetComponent <MeshRenderer>();
        if (render == null)
        {
            render = GetComponentInChildren <MeshRenderer>();
        }
        meshFilter = render.GetComponent <MeshFilter>();

        elementComponent = GetComponent <CElementComponent>();

        originMaterial = render.material;
    }
示例#3
0
 public virtual void Init(GActor owner, CElementComponent stateMachine)
 {
     this.owner        = owner;
     this.stateMachine = stateMachine;
 }