コード例 #1
0
 public void OnTriggerStay2D(Collider2D other)
 {
     if (!ignore)
     {
         CharController_RPG_Framework controller = other.gameObject.GetComponent <CharController_RPG_Framework>();
         if (controller.isOnGrid)
         {
             startTransition = true;
         }
     }
 }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        RefreshStepsToNextBattle();

        if (battleScenes.Length == 0)
        {
            Debug.LogWarning("This scene contains no battle scenes. If it is not supposed to have battles, the RandomBattleController component should be disabled or removed. If it should have random battles, you must add at least one battle scene.");
            this.enabled = false;
            return;
        }

        walkingCharacter        = GameObject.FindGameObjectWithTag("Player").GetComponent <CharController_RPG_Framework>();
        lastKnownPlayerPosition = walkingCharacter.gridPosition;
    }
コード例 #3
0
    public void DoAnimation(CharController_RPG_Framework controler)
    {
        //animate and move if moving
        if (controler.isMoving && animationSpeed != 0)
        {
            animationFrame += animationSpeed;
            if (animationFrame >= maxAnimationFrame)
            {
                animationFrame = 1;
            }
        }
        else if (animationSpeed == 0)
        {
            animationFrame = 0;
        }
        else
        {
            animationFrame = 0;
        }

        //update sprite
        switch (controler.moveDirection)
        {
        case StaticData.DIR_UP:
            sr.sprite = upSprites[Mathf.FloorToInt(animationFrame)];
            break;

        case StaticData.DIR_LEFT:
            sr.sprite = leftSprites[Mathf.FloorToInt(animationFrame)];
            break;

        case StaticData.DIR_RIGHT:
            sr.sprite = rightSprites[Mathf.FloorToInt(animationFrame)];
            break;

        case StaticData.DIR_DOWN:
            sr.sprite = downSprites[Mathf.FloorToInt(animationFrame)];
            break;
        }
    }
コード例 #4
0
ファイル: GameMaster.cs プロジェクト: languard/RPG_Framework
 public void RegisterPlayerController(CharController_RPG_Framework curController)
 {
     //this simply overrides the previous registered controller
     playerController = curController;
 }