コード例 #1
0
    public override void Execute()
    {
        Node.Complete = true;

        if (Zombie != null)
        {
            MapObjectAttribute bulletAttribute = Info.mapObject.GetAttribute <MapObjectAttribute>();
            if (bulletAttribute.Hp != 0)
            {
                MapObjectAttribute mapOjectAttribute = Zombie.GetAttribute <MapObjectAttribute>();
                mapOjectAttribute.Hp -= Info.Attack;

                bulletAttribute.Hp = 0;
            }

            AttachAttackAttribute attachAttackBuff = Info.mapObject.GetAttribute <AttachAttackAttribute>();
            if (attachAttackBuff != null)
            {
                if (attachAttackBuff.Fire > 0)
                {
                    GlobalEnvironment.Instance.Get <BuffManager>().AddBuff(Zombie, new AttachAttackBuff());
                }
            }
        }
    }
コード例 #2
0
    public override void Enter()
    {
        Info = (AttachAttackBehaviorInfo)Enviorment;

        if (Info.mapObject != null && Info.mapObject.IsActive())
        {
            mapOjectAttribute     = Info.mapObject.GetAttribute <MapObjectAttribute>();
            attachAttackAttribute = Info.mapObject.GetAttribute <AttachAttackAttribute>();
        }
    }
コード例 #3
0
    public override void Execute()
    {
        if (EnvironmentInfo == null)
        {
            return;
        }

        AttachAttackAttribute attachAttackAttribute = EnvironmentInfo.mapObject.GetAttribute <AttachAttackAttribute>();

        if (attachAttackAttribute == null)
        {
            attachAttackAttribute = new AttachAttackAttribute();
            EnvironmentInfo.mapObject.AddAttribute <AttachAttackAttribute>(attachAttackAttribute.GetType().Name, attachAttackAttribute);
        }

        attachAttackAttribute.Fire = Info.Fire;
    }
コード例 #4
0
    public override void Execute(MapObject mapObject)
    {
        AttachAttackAttribute attachAttackAttribute = mapObject.GetAttribute <AttachAttackAttribute>();

        if (attachAttackAttribute == null)
        {
            return;
        }
        MapObjectArtAttribute mapObjectArtAttribute = mapObject.GetAttribute <MapObjectArtAttribute>();

        if (mapObjectArtAttribute == null)
        {
            return;
        }
        Material material = mapObjectArtAttribute.material;

        if (material == null)
        {
            material = mapObjectArtAttribute.transform.GetComponent <MeshRenderer>().material;
            mapObjectArtAttribute.material = material;
        }

        Color color = Normal;

        if (attachAttackAttribute.Fire > 0)
        {
            color = Red;
        }

        if (mapObjectArtAttribute.material.color != color)
        {
            mapObjectArtAttribute.material.color = color;
        }
        if (!mapObjectArtAttribute.gameObject.activeSelf)
        {
            mapObjectArtAttribute.gameObject.SetActive(true);
        }
    }