示例#1
0
    public void Start()
    {
        _ambassador = (Ambassador)FindObjectOfType(typeof(Ambassador));
        _control    = GetComponent <PlayerControl>();
        _health     = GetComponent <HealthSystem>();

        if (_ambassador == null ||
            _control == null ||
            _health == null)
        {
            if (DebugMode)
            {
                Debug.LogWarning("Was unable to find player controls or ambassador!" + Environment.NewLine
                                 + "Ambassador: " + ((_ambassador == null) ? "Not Found" : "Found") + Environment.NewLine
                                 + "Player Controls: " + ((_control == null) ? "Not Found" : "Found") + Environment.NewLine
                                 + "Health System: " + ((_health == null) ? "Not Found" : "Found"));
            }

            return;
        }

        _control.canOverthrust  = _ambassador.HasItem(OverthrustSkill);
        _control.canUnderthrust = _ambassador.HasItem(UnderthrustSkill);
        _health.HP    = _ambassador.MaxHP;
        _health.MaxHP = _ambassador.MaxHP;

        if (DebugMode)
        {
            Debug.Log("Player " + (_control.canOverthrust ? "can" : "cannot") + " perform Overthrust." + Environment.NewLine
                      + "Player " + (_control.canUnderthrust ? "can" : "cannot") + " perform Underthrust."
                      + "Player's HP: " + _health.HP + "/" + _health.MaxHP);
        }
    }
    public void Start()
    {
        _ambassador = (Ambassador) FindObjectOfType(typeof(Ambassador));
        _control = GetComponent<PlayerControl>();
        _health = GetComponent<HealthSystem>();

        if(_ambassador == null
           || _control == null
           || _health == null)
        {
            if(DebugMode)
                Debug.LogWarning("Was unable to find player controls or ambassador!" + Environment.NewLine
                                 + "Ambassador: " + ((_ambassador == null) ? "Not Found" : "Found") + Environment.NewLine
                                 + "Player Controls: " + ((_control == null) ? "Not Found" : "Found") + Environment.NewLine
                                 + "Health System: " + ((_health == null) ? "Not Found" : "Found"));

            return;
        }

        _control.canOverthrust = _ambassador.HasItem(OverthrustSkill);
        _control.canUnderthrust = _ambassador.HasItem(UnderthrustSkill);
        _health.HP = _ambassador.MaxHP;
        _health.MaxHP = _ambassador.MaxHP;

        if(DebugMode)
            Debug.Log("Player " + (_control.canOverthrust ? "can" : "cannot") + " perform Overthrust." + Environment.NewLine
                      + "Player " + (_control.canUnderthrust ? "can" : "cannot") + " perform Underthrust."
                      + "Player's HP: " + _health.HP + "/" + _health.MaxHP);
    }
    public void Start()
    {
        _ambassador = (Ambassador) FindObjectOfType(typeof(Ambassador));
        _damageSource = GetComponent<DamageSource>();

        if(_ambassador == null
           || _damageSource == null)
        {
            if(DebugMode)
                Debug.LogWarning("Was unable to find damage source or ambassador!" + Environment.NewLine
                                 + "Ambassador: " + ((_ambassador == null) ? "Not Found" : "Found") + Environment.NewLine
                                 + "Damage Source: " + ((_damageSource == null) ? "Not Found" : "Found"));

            return;
        }

        if(_ambassador.HasItem(ItemName))
        {
            if(DebugMode)
                Debug.Log("This damage trigger can break breakable objects.");

            _damageSource.AffectedTags.AddRange(BreakableItemTags);
        }
        else
        {
            if(DebugMode)
                Debug.Log("This damage trigger can't break breakables.");
        }
    }
示例#4
0
    void Start()
    {
        _ambassador = (Ambassador) FindObjectOfType(typeof(Ambassador));

        if(_ambassador == null)
        {
            if(DebugMode)
                Debug.LogWarning("An ambassador was not found!");

            return;
        }

        if(_ambassador.HasItem(SkillName))
            RemoveItemFromScene();
    }
示例#5
0
    void Start()
    {
        _ambassador = (Ambassador)FindObjectOfType(typeof(Ambassador));

        if (_ambassador == null)
        {
            if (DebugMode)
            {
                Debug.LogWarning("An ambassador was not found!");
            }

            return;
        }

        if (_ambassador.HasItem(SkillName))
        {
            RemoveItemFromScene();
        }
    }
示例#6
0
    private void DeleteIfCannotUse()
    {
        if (_ambassador == null)
        {
            if (DebugMode)
            {
                Debug.LogWarning("An ambassador was not found!");
            }

            Destroy(gameObject);
            return;
        }

        if (!_ambassador.HasItem(SkillName))
        {
            if (DebugMode)
            {
                Debug.Log("Player does not have " + SkillName + ", not displaying Wind Blocks.");
            }

            Destroy(gameObject);
        }
    }