コード例 #1
0
        public void SendRegisterMessage(BroadcastMessageDataObject _msg)
        {
            if (_msg == null)
            {
                return;
            }

            //CreatureRegister.SendGroupMessage( ReferenceGroup, Owner, _msg );
            //Debug.Log ( "send from ID : " + Owner.GetInstanceID() + " - " + _msg.Type.ToString() );
        }
コード例 #2
0
        public void Message(ReferenceGroupObject _group, GameObject _sender, BroadcastMessageDataObject _msg)
        {
            if (_sender == null)
            {
                return;
            }

            if (OnGroupMessage != null)
            {
                OnGroupMessage(_group, _sender, _msg);
            }
        }
コード例 #3
0
        public void Message(GameObject _sender, BroadcastMessageDataObject _msg)
        {
            if (_sender == null)
            {
                return;
            }

            if (OnGroupMessage != null)
            {
                OnGroupMessage(this, _sender, _msg);
            }
        }
コード例 #4
0
        public void Copy(BroadcastMessageDataObject _object)
        {
            if (_object == null)
            {
                return;
            }

            base.Copy(_object);

            Type             = _object.Type;
            Command          = _object.Command;
            TargetGameObject = _object.TargetGameObject;
            BahaviourKey     = _object.BahaviourKey;
        }
コード例 #5
0
        public void SendGroupMessage(BroadcastMessageDataObject _msg)
        {
            if (_msg == null || Owner == null)
            {
                return;
            }

            PrintDebugLog(this, "send from ID : " + Owner.GetInstanceID() + " - " + _msg.Type.ToString());

            if (ReferenceGroup != null)
            {
                ReferenceGroup.Message(Owner, _msg);
            }
        }
コード例 #6
0
        public void ResetActiveTarget()
        {
            // handle previous target
            m_PreviousTarget           = m_ActiveTarget;
            m_PreviousTargetGameObject = m_ActiveTargetGameObject;
            m_PreviousTargetID         = m_ActiveTargetID;
            m_PreviousTargetName       = m_ActiveTargetName;
            m_PreviousTargetKey        = m_ActiveTargetName + m_ActiveTargetID.ToString();

            if (m_PreviousTarget != null)
            {
                m_PreviousTarget.SetActive(false);

                if (m_PreviousTarget.EntityComponent != null)
                {
                    m_PreviousTarget.EntityComponent.RemoveActiveCounterpart(OwnerComponent as ICECreatureEntity);
                }

                if (m_PreviousTarget.GroupMessage.Type != BroadcastMessageType.NONE)
                {
                    BroadcastMessageDataObject _data = new BroadcastMessageDataObject();
                    _data.Type             = m_PreviousTarget.GroupMessage.Type;
                    _data.TargetGameObject = m_PreviousTargetGameObject;
                    _data.Command          = "";

                    ICECreatureEntity _entity = OwnerComponent as ICECreatureEntity;
                    if (_entity != null)
                    {
                        _entity.Message.SendGroupMessage(_data);
                    }
                }
            }

            m_ActiveTarget           = null;
            m_ActiveTargetGameObject = null;
            m_ActiveTargetID         = 0;
            m_ActiveTargetName       = "";
            m_ActiveTargetKey        = "";
        }
コード例 #7
0
 public BroadcastMessageDataObject(BroadcastMessageDataObject _object) : base(_object)
 {
     Copy(_object);
 }
コード例 #8
0
        public void ReceiveGroupMessage(ReferenceGroupObject _group, GameObject _sender, BroadcastMessageDataObject _msg)
        {
            if (_group == null || _sender == null || _msg == null)
            {
                return;
            }

            PrintDebugLog(this, "receive from ID : " + _sender.GetInstanceID() + " - " + _msg.Type.ToString());

            switch (_msg.Type)
            {
            case BroadcastMessageType.COMMAND:
                LastReceivedCommand = _msg.Command;
                break;

            default:
                break;
            }
        }