예제 #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;
            }
        }