Exemplo n.º 1
0
    //Function : MouseBtnDownSelectedFunction
    //Method : This is the Function used To Selected The Function Statement
    void MouseBtnDownSelectedFunction(Vector2 screenPosition)
    {
        Ray ray = cam.ScreenPointToRay(screenPosition);

        RaycastHit rayCastHit;

        if (Physics.Raycast(ray,
                            out rayCastHit,
                            Mathf.Infinity,
                            UnitLayerMask))
        {
            scoopListScript.Clear();

            ScoopScript scoopscriptWithCollider = rayCastHit.collider.GetComponent <ScoopScript>();



            if (PlayerManagerScript.instance.scoopScriptList.Contains(scoopscriptWithCollider))
            {
                if (scoopscriptWithCollider != null)
                {
                    scoopListScript.Add(scoopscriptWithCollider);
                    scoopscriptWithCollider.GetHasBeenSelectorObject().SetActive(true);
                    //      scoopscriptWithCollider.GETSCOOPUICRTSTATEMENT().gameObject.SetActive(true);

                    SETBubbleObjectActiveFunction(true);
                }
            }
        }

        else if (Physics.Raycast(ray, out rayCastHit, Mathf.Infinity, AreaLevelBlock))
        {
            if (rayCastHit.collider.gameObject.CompareTag(TagsObjectScript.CantCreateBuildingObjTagsName))
            {
                if (!UIManager.instance.HasEnterTheBtnBoolean)
                {
                    if (!UIManager.instance.GetUNLockPanelObject().activeInHierarchy)
                    {
                        if (!UIManager.instance.GetRequireLevelPanelFunction().activeInHierarchy)
                        {
                            InstanEnemiesScirpt instanEnemiesScript = rayCastHit.collider.GetComponent <InstanEnemiesScirpt>();



                            SetInstanEnemyFunction(instanEnemiesScript);

                            if (instanEnemiesScript != null)
                            {
                                if (instanEnemiesScript.Unlocked)
                                {
                                    if (PlayerManagerScript.instance.Gold >= instanEnemiesScript.GoldenCost)
                                    {
                                        UIManager.instance.GetYesButtonFunction().interactable = true;
                                        UIManager.instance.GetNoButtonFunction().interactable  = true;
                                    }
                                    else if (PlayerManagerScript.instance.Gold < instanEnemiesScript.GoldenCost)
                                    {
                                        UIManager.instance.GetYesButtonFunction().interactable = false;
                                        UIManager.instance.GetNoButtonFunction().interactable  = true;
                                    }

                                    UIManager.instance.GetUNLockPanelObject().SetActive(true);

                                    SetCostFunction(instanEnemiesScript.GoldenCost);
                                }
                                else
                                {
                                    UIManager.instance.GetUNLockPanelObject().SetActive(false);
                                }

                                //  SetAskingCubeObject(rayCastHit.collider.GetComponent<AskingCubeBoxScript>());
                            }
                        }
                    }



                    if (!UIManager.instance.GetRequireLevelPanelFunction().activeInHierarchy)
                    {
                        SetHaveLevelToUnlockThisGround(rayCastHit.collider.gameObject.GetComponent <HaveLevelToUnlockThisGroundScript>());

                        //     Debug.Log(haveLevelToUnlockThisGroundScript);



                        if (haveLevelToUnlockThisGroundScript != null)
                        {
                            //               Debug.Log("Has Pressed The Has Level To Unlock ");


                            //      Debug.Log("You Have Click The To Unlock Level");



                            if (haveLevelToUnlockThisGroundScript.isUnlock)
                            {
                                if (PlayerManagerScript.instance.Gold >= haveLevelToUnlockThisGroundScript.Cost)
                                {
                                    UIManager.instance.GetYesButtonFunction().interactable = true;
                                    UIManager.instance.GetNoButtonFunction().interactable  = true;
                                }
                                else if (PlayerManagerScript.instance.Gold < haveLevelToUnlockThisGroundScript.Cost)
                                {
                                    UIManager.instance.GetYesButtonFunction().interactable = false;
                                    UIManager.instance.GetNoButtonFunction().interactable  = true;
                                }

                                SetCostFunction(haveLevelToUnlockThisGroundScript.Cost);


                                UIManager.instance.GetUNLockPanelObject().SetActive(true);
                            }
                            else
                            {
                                UIManager.instance.GetRequireLevelPanelFunction().SetActive(true);
                                UIManager.instance.SetRequiredLevelTextFunction(haveLevelToUnlockThisGroundScript.GetTheUnlockRequipmentTextFunction());
                                UIManager.instance.SetHaveUnlockLevelTextFunction(haveLevelToUnlockThisGroundScript.GetTheHaveUnlockRequipmentTextFunction());
                            }
                        }
                    }
                }
            }
        }
    }
Exemplo n.º 2
0
 //Function : SetInstanEnemyFunction
 //Method : This is the Function used For Setting The InstanEnemy Function
 public void SetInstanEnemyFunction(InstanEnemiesScirpt instan = null)
 {
     INSTANENEMIESSCRIPT = instan;
 }
    //Function : InstanboxColliderScript

    //Method : This is the Function used For Insgtane The Box Collider
    public void InstanboxColliderScript(InstanEnemiesScirpt instan = null)
    {
        instanEnemyBoxCollider = instan;
    }