Example #1
0
 void CreatSeed(int num)
 {
     particileControl.Play(0, 2, ShootPos[0].transform.parent.transform.position);
     for (int i = 0; i < num; i++)
     {
         Instantiate(seed, ShootPos[i].transform.position, ShootPos[i].transform.rotation);
         seed.GetComponent <Rigidbody>().AddForce(Vector3.forward * Random.Range(1, 5), ForceMode.Impulse);
     }
 }
Example #2
0
    // Use this for initialization
    void Start()
    {
        ParticlePos      = this.transform.position;
        ParticlePos.y    = 0;
        ParticlePos     += new Vector3(0, 1, 0);
        medicine         = transform.GetChild(3).gameObject;
        particileControl = GetComponent <ParticileControl>();
        StartCoroutine(MedicineInPut(3f, .05f));

        particileControl.Play(1, 3f, ParticlePos + new Vector3(Random.Range(-5, 5), 0, Random.Range(-5, 5)));
        particileControl.Play(1, 3f, ParticlePos + new Vector3(Random.Range(-5, 5), 0, Random.Range(-5, 5)));
        particileControl.Play(1, 3f, ParticlePos + new Vector3(Random.Range(-5, 5), 0, Random.Range(-5, 5)));
    }
 public void GetDoBoost()
 {
     if (growMaoControl.growState == 1)
     {
         growMaoControl.currentBoostIndex++;
         //growMaoControl.ScaleModel();
     }
     particileControl.Play(0, 2, this.transform.position + new Vector3(0, 0.5f, 0));
 }
Example #4
0
    private void MedicineInput()
    {
        if (medicine.transform.localScale.y <= 0.1f)
        {
            Debug.Log("PassStage");
            aIGameManger.DeadAllEnemy();
            //timeline
            IsPass = true;
            stageData.m_datainfolist.stageData.Pass = IsPass;

            particileControl.Play(0, 10, this.transform.position + new Vector3(0, -4.5f, 0));
            if (PlaceObj != null)
            {
                PlaceObj.SetActive(true);
            }
        }
        else if (medicine.transform.localScale.y > 0.1f && !IsPass)
        {
            MedicineIn = false;
            medicine.transform.localScale -= new Vector3(0, .05f, 0);
        }
    }
Example #5
0
    public void CureFinish()
    {
        GameObject.FindObjectOfType <StageChallange>().PassChallange += 1;
        particileControl.Play(0, 8, ParticlePos);
        //EventManager.TriggerEvent("Spawn");
        //StartCoroutine(DeadEnemy(1f));
        EventManager.TriggerEvent("DeadEnemy");
        Destroy(this.gameObject, .3f);
        //sound
        //if(teach.Instance.FirstFinsh == false)
        //{
        //    teach.Instance.SkipTeach = false;
        //    teach.Instance.TeachLevel = 156;
        //}

        //-----
        EventManager.TriggerEvent(" ShowChallangeInfo");
    }
 public virtual void MotionDead()
 {
     nav.Stop();
     particileControl.Play(1, 2F, Role.transform.position);
     PlayAnim("Dead", -1.0f);
 }
Example #7
0
    private void DoAnim()
    {
        ////////////////////////////////////////NEED RECODING////////////////////////
        //float input_x = Input.GetAxis("Horizontal");
        //float input_y = Input.GetAxis("Vertical");
        //float totalInput = (input_x + input_y);

        if (Input.GetMouseButtonDown(0) && bc.PropInfo() != "GUN")
        {
            if (m_anim.GetCurrentAnimatorStateInfo(0).IsName("Idle") || m_anim.GetCurrentAnimatorStateInfo(0).IsName("Walk") || m_anim.GetCurrentAnimatorStateInfo(0).IsName("Run"))
            {
                //if (holeList.Count > 0)
                //{
                //    if (bc.PropEnough())
                //    {
                //        if (FirstPutSeed == false && teach.Instance.TeachLevel == 50)
                //        {
                //            teach.Instance.TeachLevel++;
                //            FirstPutSeed = true;
                //        }
                //        PlayAnim("Put", 0);
                //        updateFollow.enabled = false;
                //        updateFollow.ReturnPos();
                //        string Path = bc.PropInfo();
                //        switch (Path)
                //        {
                //            case "S0":
                //                Count.Instance.number[0]--;
                //                break;
                //            case "S1":
                //                Count.Instance.number[1]--;
                //                break;
                //            case "S2":
                //                Count.Instance.number[2]--;
                //                break;
                //            case "S3":
                //                Count.Instance.number[3]--;
                //                break;
                //            case "S4":
                //                Count.Instance.number[4]--;
                //                break;

                //            default:
                //                break;
                //        }
                //        PutSeed(Path);
                //    }
                //}
                //else
                //{
                //    //Debug.LogWarning( "Bc prop is " +bc.Props[bc.Choose].name + "choose = " + bc.Choose + "is" + bc.PropEnough());
                //    if (bc.PropEnough())
                //    {
                //        if (FirstPutJar == false && teach.Instance.SkipTeach == false)
                //        {
                //            teach.Instance.TeachLevel = 63;
                //            FirstPutJar = true;
                //        }

                //        PlayAnim("Put", 0);
                //        //Debug.LogWarning(bc.PropInfo());
                //        string Path = bc.PropInfo();
                //        switch (Path)
                //        {
                //            case "S0":
                //                Count.Instance.number[0]--;
                //                break;
                //            case "S1":
                //                Count.Instance.number[1]--;
                //                break;
                //            case "S2":
                //                Count.Instance.number[2]--;
                //                break;
                //            case "S3":
                //                Count.Instance.number[3]--;
                //                break;
                //            case "S4":
                //                Count.Instance.number[4]--;
                //                break;

                //            default:
                //                break;
                //        }

                //        PutJar(Path);
                //    }
                //}


                if (holeList.Count > 0)
                {
                    if (bc.PropEnough())
                    {
                        PlayAnim("Put", 0);
                        updateFollow.enabled = false;
                        updateFollow.ReturnPos();
                        string Path = bc.PropInfo();
                        switch (Path)
                        {
                        case "S0":
                            Count.Instance.number[0]--;
                            break;

                        case "S1":
                            Count.Instance.number[1]--;
                            break;

                        case "S2":
                            Count.Instance.number[2]--;
                            break;

                        case "S3":
                            Count.Instance.number[3]--;
                            break;

                        case "S4":
                            Count.Instance.number[4]--;
                            break;

                        default:
                            break;
                        }
                        PutSeed(Path);
                    }
                }
                else
                {
                    if (bc.PropEnough())
                    {
                        PlayAnim("Put", 0);
                        string Path = bc.PropInfo();
                        switch (Path)
                        {
                        case "S0":
                            Count.Instance.number[0]--;
                            break;

                        case "S1":
                            Count.Instance.number[1]--;
                            break;

                        case "S2":
                            Count.Instance.number[2]--;
                            break;

                        case "S3":
                            Count.Instance.number[3]--;
                            break;

                        case "S4":
                            Count.Instance.number[4]--;
                            break;

                        default:
                            break;
                        }

                        PutJar(Path);
                    }
                }
            }
        }
        else if (Input.GetMouseButtonDown(0) && bc.PropInfo() == "GUN")
        {
            if (m_anim.GetCurrentAnimatorStateInfo(0).IsName("Idle") || m_anim.GetCurrentAnimatorStateInfo(0).IsName("Walk") || m_anim.GetCurrentAnimatorStateInfo(0).IsName("Run"))
            {
                //PlayAnim("Shoot",0f);
                StartCoroutine(PlayShoot());
                ShootObj(.2f);
            }
        }

        //if (Input.GetKeyDown(KeyCode.Space))
        //{
        //    if (FrontObj != null && TwicePickUP == true  && teach.Instance.teachcanvas.activeInHierarchy == false)
        //    {
        //        PlayAnim("PickUp", 0);
        //        TwicePickUP = false;
        //        PickUp();

        //    }
        //    else if (FrontObj != null && TwicePickUP == true && teach.Instance.TeachLevel != 41 && teach.Instance.teachcanvas.activeInHierarchy == false)
        //    {
        //        PlayAnim("PickUp", 0);
        //        TwicePickUP = false;
        //        PickUp();

        //    }
        //    else if (FrontObj != null && teach.Instance.teachcanvas.activeInHierarchy == false)
        //    {
        //        PlayAnim("PickUp", 0);
        //        PickUp();
        //    }
        //}

        if (m_anim.GetCurrentAnimatorStateInfo(0).IsName("Walk"))
        {
            currentCreatSmoke += Time.deltaTime;
            if (currentCreatSmoke > WalkSmokeTime)
            {
                currentCreatSmoke = 0;
                particileControl.Play(2, 1, transform.position + new Vector3(0, .5f, 0));
            }
            audioController.PlaySound(3);
        }
        else if (m_anim.GetCurrentAnimatorStateInfo(0).IsName("Run"))
        {
            currentCreatSmoke += Time.deltaTime;
            if (currentCreatSmoke > RunSmokeTime)
            {
                currentCreatSmoke = 0;
                particileControl.Play(2, 1, transform.position + new Vector3(0, .5f, 0));
            }
            audioController.StopIndexSound(3);
            audioController.PlaySound(0);
        }
        else
        {
            audioController.StopSound(3);
            audioController.StopSound(0);
        }
    }