コード例 #1
0
    /// <summary>
    /// 상호작용 버튼
    /// </summary>
    public void Speechup()
    {
        if (!is_Trigger)
        {
            if (HJ.Manager.DialogueManager.is_nextmsg && HJ.Manager.DialogueManager.is_Msg)
            {
                return;
            }

            NPCInformation info = collider2d.GetComponent <NPCInformation>();
            if (info == null)
            {
                return;
            }

            //? 플레이메이커
            //info.fsmBox.SendEvent("NPC");
            info.PlayerRayCast();           //? 플레이 레이케스트 실행
        }
        else
        {
            WarpScript info = collider2d.GetComponent <WarpScript>();

            if (info == null)
            {
                return;
            }

            info.TelePort();

            info = null;
        }

        // Debug.Log(info._name);
    }
コード例 #2
0
 void CastRay()
 {
     //using the unity manual here.
     //Ignores the heat volume, finds the ground below the target, instantiates that wibbly heat effect there.
     //If there's a problem with that, instantiates the wibbly heat effect at its location.
     //Needs a collider under the map to function.
     trajectory = new Ray(transform.position + new Vector3(0.0f, -1.0f, 0.0f), Vector3.down);
     if (Physics.Raycast(trajectory, out targetpoint, Mathf.Infinity, layerMask) && targetpoint.collider != null)
     {
         if (targetpoint.transform.gameObject.tag == "Target" && targetpoint.distance <= 2.0f)
         {
             warpPoint    = targetpoint.point;
             warpPoint.y -= 0.2f;
             myWarp       = Instantiate(heatWarp, warpPoint, Quaternion.identity /*, gameObject.transform*/);
         }
         else
         {
             myWarp = Instantiate(heatWarp, transform.position, Quaternion.identity /*, gameObject.transform*/);
         }
         myWarpScript = myWarp.GetComponent <WarpScript>();
     }
 }
コード例 #3
0
    void Update()
    {
        if (Input.GetButtonDown("Interact") && GameMaster.CurrentGameState == GameState.Flying)
        {
            if (m_targetInteractible != null)
            {
                m_targetInteractible.OnInteract();
            }
        }

        if (Input.GetButtonDown("Warp") && GameMaster.CurrentGameState == GameState.Flying)
        {
            GameObject warpMngr   = (GameObject)GameObject.Find("Warp Manager");
            WarpScript warpScript = warpMngr.GetComponent <WarpScript>();

            warpScript.CallHangar();
        }

        //TEMPORARY -- This functionality will be replaced with the Space Station UI
        if (Input.GetKeyDown(KeyCode.E) && GameMaster.CurrentGameState != GameState.Customization)
        {
            if (m_targetInteractible != null)
            {
                GameMaster.CurrentGameState = GameState.Customization;
                interactText.SetActive(false);
            }
        }
        if (Input.GetKeyDown(KeyCode.Escape) && GameMaster.CurrentGameState == GameState.Customization)
        {
            if (m_targetInteractible != null)
            {
                GameMaster.CurrentGameState = GameState.Flying;
                interactText.SetActive(true);
            }
        }
    }
コード例 #4
0
ファイル: WarpScript.cs プロジェクト: Charnock/Space
 // Use this for initialization
 void Start()
 {
     if (instance == null) {
         instance = this;
     }
     starBackground = (GameObject)GameObject.Find ("StarBackground");
     allPlanets = new List<GameObject> ();
     LoadAllSectors();
     LoadSector ();//LOL
 }