示例#1
0
 public int AddNewSoul(int soulTypeId)
 {
     m_Soul        = new Souls();
     m_Soul.Id     = (int)CacheSet.SoulCache.GetNextNo();
     m_Soul.TypeId = soulTypeId;
     CacheSet.SoulCache.Add(m_Soul);
     return(m_Soul.Id);
 }
示例#2
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (this != instance)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
    public void PickupCollision(GameObject pickup)
    {
        Souls soulsInstance = pickup.GetComponent <Souls>();

        if (_currentPlayerSprite == null)
        {
            _currentPlayerSprite = LevelManager.Instance.Player.transform.GetChild(0).GetComponent <SpriteRenderer>();
        }
        if (soulsInstance != null)
        {
            if (soulsInstance.SoulType == 0)
            {
                playerPickupCount++;
            }
            else
            {
                playerPickupCount--;
            }
            playerPickupCount = Mathf.Clamp(playerPickupCount, -5, 5);
        }

        if (playerPickupCount <= -2)
        {
            _currentPlayerSprite.sprite = spriteGood;
        }
        else if (playerPickupCount >= 2)
        {
            _currentPlayerSprite.sprite = spriteEvil;
        }
        else
        {
            _currentPlayerSprite.sprite = spriteNeutral;
        }

        pickup.SetActive(false);
    }
示例#4
0
 public virtual Vector2 GetDirectionOfSoul(Souls Player, List <NPC> Enemy)
 {
     return(Direction = ninja.transform.position - transform.position);
 }
示例#5
0
 public void SetSoul(int soulId)
 {
     m_Soul = CacheSet.SoulCache.FindKey(soulId);
 }