コード例 #1
0
 private void FireTongue()
 {
     //TODO: Get the tongue to shoot out (I suggest using tongueLine)
     // 1. tongue goes towards mouse position
     mousePosition = (Vector3)GetCurrentMousePosition();
     tip.SetTargetPosition(mousePosition);
     // 2. tongue moves out and back if it misses
     tip.isPlayerTongueing = true;
     tip.isTongueExtending = true;
     // 3. if the tongue tip touches an enemy, call something to start the fishing minigame (this can be a blank method for now)
 }
コード例 #2
0
    private void FireTongue()
    {
        spriteRenderer.sprite = ResourceLoader.instance.mimicOpenedSprite;

        //TODO: Get the tongue to shoot out (I suggest using tongueLine)
        // 1. tongue goes towards mouse position
        tip.GetComponent <SpriteRenderer>().enabled = true;
        tongueLine.sortingLayerName = "Tongue";
        mousePosition = (Vector3)GetCurrentMousePosition();
        tip.SetTargetPosition(mousePosition);
        // 2. tongue moves out and back if it misses
        tip.isPlayerTongueing = true;
        tip.isTongueExtending = true;
        // 3. if the tongue tip touches an enemy, call something to start the fishing minigame (this can be a blank method for now)

        AudioManager.instance.PlaySound("Tongue_Extend");
    }