Пример #1
0
 private void ShowGUIAll(BTBase self)
 {
     CopyMeshFromRoot(self);
     self.FitName();
     for (var i = 0; i < self.transform.childCount; i++)
     {
         ShowGUIAll(self.transform.GetChild(i).GetComponent <BTBase>());
     }
 }
Пример #2
0
        protected void CopyMeshFromRoot(BTBase self)
        {
            if (self == self.Root || self.GetComponent <TextMeshPro>())
            {
                return;
            }
            var curText = self.gameObject.AddComponent <TextMeshPro>();

            UnityEditorInternal.ComponentUtility.CopyComponent(self.Root.GetComponent <TextMeshPro>());
            UnityEditorInternal.ComponentUtility.PasteComponentValues(curText);

            var curMr = self.GetComponent <MeshRenderer>();

            curMr.sharedMaterial = Instantiate(self.Root.GetComponent <MeshRenderer>().sharedMaterial);

            var curRect = self.GetComponent <RectTransform>();
            var oldPos  = curRect.position;

            UnityEditorInternal.ComponentUtility.CopyComponent(self.Root.GetComponent <RectTransform>());
            UnityEditorInternal.ComponentUtility.PasteComponentValues(curRect);
            curRect.position = oldPos;
        }
Пример #3
0
        public override bool Load()
        {
            AgentMeta.TotalSignature = 2632253247;

            AgentMeta meta;

            // behaviac.Agent
            meta = new AgentMeta(24743406);
            AgentMeta._AgentMetas_[2436498804] = meta;
            meta.RegisterMethod(1045109914, new CAgentStaticMethodVoid <string>(delegate(string param0) { behaviac.Agent.LogMessage(param0); }));
            meta.RegisterMethod(2521019022, new CMethod_behaviac_Agent_VectorAdd());
            meta.RegisterMethod(2306090221, new CMethod_behaviac_Agent_VectorClear());
            meta.RegisterMethod(3483755530, new CMethod_behaviac_Agent_VectorContains());
            meta.RegisterMethod(505785840, new CMethod_behaviac_Agent_VectorLength());
            meta.RegisterMethod(502968959, new CMethod_behaviac_Agent_VectorRemove());

            // BTBase
            meta = new AgentMeta(271115113);
            AgentMeta._AgentMetas_[552565153] = meta;
            meta.RegisterMemberProperty(1149798316, new CMemberProperty <bool>("p_IsCanMove", delegate(Agent self, bool value) { ((BTBase)self)._set_p_IsCanMove(value); }, delegate(Agent self) { return(((BTBase)self)._get_p_IsCanMove()); }));
            meta.RegisterMemberProperty(442615142, new CMemberProperty <bool>("p_IsMoveing", delegate(Agent self, bool value) { ((BTBase)self)._set_p_IsMoveing(value); }, delegate(Agent self) { return(((BTBase)self)._get_p_IsMoveing()); }));
            meta.RegisterMethod(1152745203, new CAgentMethodVoid <float>(delegate(Agent self, float distance) { ((BTBase)self).GetTargetPos(distance); }));
            meta.RegisterMethod(1759823772, new CAgentMethod <bool>(delegate(Agent self) { return(((BTBase)self).IsNearTargetPos()); }));
            meta.RegisterMethod(1045109914, new CAgentStaticMethodVoid <string>(delegate(string param0) { BTBase.LogMessage(param0); }));
            meta.RegisterMethod(1793645156, new CAgentMethodVoid <float>(delegate(Agent self, float speed) { ((BTBase)self).MoveToTarget(speed); }));
            meta.RegisterMethod(4017898676, new CAgentMethodVoid <string, bool>(delegate(Agent self, string param, bool enable) { ((BTBase)self).SetAnimatorBoolParameter(param, enable); }));
            meta.RegisterMethod(2521019022, new CMethod_behaviac_Agent_VectorAdd());
            meta.RegisterMethod(2306090221, new CMethod_behaviac_Agent_VectorClear());
            meta.RegisterMethod(3483755530, new CMethod_behaviac_Agent_VectorContains());
            meta.RegisterMethod(505785840, new CMethod_behaviac_Agent_VectorLength());
            meta.RegisterMethod(502968959, new CMethod_behaviac_Agent_VectorRemove());

            AgentMeta.Register <behaviac.Agent>("behaviac.Agent");
            AgentMeta.Register <BTBase>("BTBase");
            return(true);
        }
Пример #4
0
 public void SubEnergy(float value)
 {
     _energy -= value;
     BTBase.UpdateParameter(BTConstant.Energy, Energy());
 }