void Start()
 {
     player   = BattleManagerScript.Instance.player;
     targeted = false;
     posX     = this.gameObject.transform.position.x;
     posY     = this.gameObject.transform.position.y;
 }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        timer         = 0f;
        limit_timer   = 0f;
        step          = STEP.STOP;
        obj           = this.gameObject;
        last_position = this.gameObject.transform.position;
        input_manager = InputField.GetComponent <InputManager>();
        player_state  = this.gameObject.GetComponent <PlayerStatusScript>();

        right       = "right";
        left        = "left";
        up          = "up";
        down        = "down";
        open        = "open";
        hide        = "hide";
        creatmycopy = "creatmycopy";
        shot        = "shot";

        scroll_content = GameObject.FindGameObjectWithTag("Content");
        scroll_control = scroll_content.GetComponent <ScrollControl>();

        right_arrow_text = GameObject.FindGameObjectWithTag("rightarrowtext").GetComponent <Text>();
        down_arrow_text  = GameObject.FindGameObjectWithTag("downarrowtext").GetComponent <Text>();
        left_arrow_text  = GameObject.FindGameObjectWithTag("leftarrowtext").GetComponent <Text>();
        up_arrow_text    = GameObject.FindGameObjectWithTag("uparrowtext").GetComponent <Text>();
        fire_shot_text   = GameObject.FindGameObjectWithTag("fireshottext").GetComponent <Text>();
    }
예제 #3
0
    void Start()
    {
        gameObject.GetComponent <MeshRenderer>().enabled = false;
        isTriggered = false;

        Player     = GameObject.Find("Player");
        MainCamera = GameObject.Find("Main Camera");
        FlashLight = GameObject.Find("Spotlight");

        mPlayerStatusScript = Player.GetComponent <PlayerStatusScript>();
        mPlayerController   = Player.GetComponent <PlayerController>();
        mCameraRayScript    = MainCamera.GetComponent <CameraRayScript>();
        mCrawlScript        = Player.GetComponent <CrawlScript>();
        mExamineScript      = GameObject.Find("CrawlExamine").GetComponent <ExamineScript>();

        AxisController[] axisControllerList = Player.GetComponents <AxisController>();
        for (int i = 0; i < axisControllerList.GetLength(0); i++)
        {
            if (axisControllerList[i].Name == "Right")
            {
                mAxisControllerRight = axisControllerList[i];
                break;
            }
        }
    }
예제 #4
0
 void Start()
 {
     player       = GameObject.FindGameObjectWithTag("Player");
     player_statu = player.GetComponent <PlayerStatusScript>();
     player_statu.AddDummyNow(1);
     timer = 0;
 }
예제 #5
0
    void Start()
    {
        Player = GameObject.Find("Player");
        mPlayerStatusScript = Player.GetComponent <PlayerStatusScript>();
        mSwipeController    = Player.GetComponent <SwipeController>();
        mClickController    = Player.GetComponent <ClickController>();
        mTriggerScript      = GameObject.Find("TriggerDaughter").GetComponent <TriggerScript>();
        mAudioSource        = GameObject.Find("ScreamSound2").GetComponent <AudioSource>();
        mButton             = (Texture2D)Resources.Load("btn_press");

        gameObjectPrefab = GameObject.FindGameObjectWithTag("Yuriko");
        AddAnimationSequence("MoveBackScript", 5.5f, false);

        IsEnabled        = false;
        IsCrawlOnly      = false;
        mActionSequence  = ActionSequence.CRAWL;
        mButtonSequence1 = (Texture2D)Resources.Load("1 copy");
        mButtonSequence2 = (Texture2D)Resources.Load("2 copy");
        mButtonSequence3 = (Texture2D)Resources.Load("3 copy");
        mButtonSequence4 = (Texture2D)Resources.Load("4 copy");

        mButton        = (Texture2D)Resources.Load("btn_press");
        mButtonPressed = (Texture2D)Resources.Load("gui_press");
        mSwipe         = (Texture2D)Resources.Load("gui_swipeLeft");
        MyStyle        = new GUIStyle();
    }
예제 #6
0
    void Start()
    {
        gameObjectPrefab    = GameObject.FindGameObjectWithTag("Father");
        mPlayerStatusScript = GameObject.Find("Player").GetComponent <PlayerStatusScript>();
        mClickController    = GameObject.Find("Player").GetComponent <ClickController>();
        mSwipeController    = GameObject.Find("Player").GetComponent <SwipeController>();
        mTriggerScript      = GameObject.Find("TriggerFather").GetComponent <TriggerScript>();
        AddAnimationSequence("MoveScript", mTimeIdle, false);
        mAudioSource = GameObject.Find("ScreamSound").GetComponent <AudioSource>();


        mButton        = (Texture2D)Resources.Load("btn_press");
        mButtonPressed = (Texture2D)Resources.Load("gui_press");
        mSwipe         = (Texture2D)Resources.Load("gui_swipeRight");

        mTime         = 0.0f;
        mTimeIdle     = 0.0f;
        mTimeInput    = 3.0f;
        mImageTime    = 0.0f;
        mImageTimeMax = 0.5f;

        mValueX      = 0.45f;
        mValueY      = 0.45f;
        mValueOffSet = 0.1f;

        mIsCompleted   = false;
        mSetInitialVal = true;
        mIsDamaged     = false;
        //AddAnimationSequence("AttackScript", 2.0f, false);
        MyStyle = new GUIStyle();
    }
예제 #7
0
    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        tempHealth           = 0;
        health               = 10;
        isDead               = false;
        deathCoroutine       = null;
        energyShield         = null;
        healthRegenCoroutine = null;

        objectMesh = GetComponent <MeshFilter>().mesh;
        materials  = GetComponent <MeshRenderer>().materials;


#if UNITY_EDITOR
        health = 5000000;
#endif
    }
예제 #8
0
 protected PlayerStatusScript GetPlayerStatusScript()
 {
     if (this.playerStatusScript == null)
     {
         this.playerStatusScript = TurnManager.GetCurrentPlayer().GetComponent <PlayerStatusScript>();
     }
     return(this.playerStatusScript);
 }
예제 #9
0
    protected override Action GetNewAction()
    {
        UnitFrameGUIScript script       = this.transform.parent.GetComponent <UnitFrameGUIScript>();
        PlayerStatusScript statusScript = script.GetPlayer();
        PlayerActionScript actionScript = statusScript.GetComponent <PlayerActionScript>();

        return(new SwitchTurnAction(selectionSound, continuousSound, endActionSound, actionScript));
    }
예제 #10
0
 private PlayerStatusScript GetPlayerStatusScript()
 {
     if (playerStatusScript == null)
     {
         playerStatusScript = this.GetComponent <PlayerStatusScript>();
     }
     return(playerStatusScript);
 }
예제 #11
0
    // Start is called before the first frame update
    void Start()
    {
        player = GameObject.Find("Player");
        transf = player.transform;

        state = GameObject.Find("GameState").GetComponent <GameStateScript>();
        ps    = GameObject.Find("PlayerStatus").GetComponent <PlayerStatusScript>();
        scene = GameObject.Find("SceneChanger").GetComponent <SceneChangerScript>();
    }
    void Start()
    {
        B4 = GameObject.FindGameObjectWithTag("B4");
        MiMi = GameObject.FindGameObjectWithTag("MiMi");
        B4Status = B4.GetComponent<PlayerController>().playerStatus;
        MiMiStatus = MiMi.GetComponent<PlayerController>().playerStatus;

        canEmpower = B4Status.getCanEmpowerStatus();
    }
예제 #13
0
    void Start()
    {
        B4 = GameObject.FindGameObjectWithTag("B4");
        B4Status = B4.GetComponent<PlayerController>().playerStatus;
        GUIB4 = GameObject.FindGameObjectWithTag("GUIB4Status").GetComponent<Text>();

        MiMi = GameObject.FindGameObjectWithTag("MiMi");
        MiMiStatus = MiMi.GetComponent<PlayerController>().playerStatus;
        GUIMiMi = GameObject.FindGameObjectWithTag("GUIMiMiStatus").GetComponent<Text>();
    }
 // Update is called once per frame
 void FixedUpdate()
 {
     if (status == null)
     {
         status = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerStatusScript>();
         if (status != null)
         {
             status.onHealthChange += HealthChange;
         }
     }
 }
예제 #15
0
    // Use this for initialization
    void Start()
    {
        obj           = this.gameObject;
        timer         = 0f;
        limit_timer   = 0f;
        step          = STEP.STOP;
        last_position = this.gameObject.transform.position;

        player       = GameObject.FindGameObjectWithTag("Player");
        player_temp  = GameObject.FindGameObjectWithTag("Player");
        player_state = player.GetComponent <PlayerStatusScript>();
    }
    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        playerVariables = new Dictionary <string, int>();
    }
예제 #17
0
    // Use this for initialization
    void Start()
    {
        player         = GameObject.FindGameObjectWithTag("Player");
        player_status  = player.GetComponent <PlayerStatusScript>();
        scroll_content = GameObject.FindGameObjectWithTag("Content");
        scroll_control = scroll_content.GetComponent <ScrollControl>();

        key_flg = new bool[key.Length];
        for (int i = 0; i < key_flg.Length; i++)
        {
            key_flg[i] = false;
        }
    }
예제 #18
0
    // Update is called once per frame
    void Update()
    {
        if (mv == null)
        {
            mv = this.gameObject.GetComponentInParent <PlayerStatusScript>();
        }


        bool walking = mv.IsMoving();

        mAnimator.SetBool("walking", walking);
        if (mv.IsInteractingWithObject())
        {
            mv.SetInteractingWithObject(false);
            mAnimator.SetTrigger("openingADoor");
        }
    }
예제 #19
0
 // Update is called once per frame
 void FixedUpdate()
 {
     if (status == null)
     {
         status = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerStatusScript>();
         if (status != null)
         {
             status.onScrapChange += ScrapChange;
         }
     }
     if (!hasBoss)
     {
         if (SceneManagerScript.GM.Boss != null)
         {
             hasBoss = true;
             SceneManagerScript.GM.Boss.onBossHealthChange += ScrapChange;
         }
     }
 }
    void Update()
    {
        // This needs to be set here, but ideally needs to happen in another function.
        // This is caused since playerStatusScript is created in the Start of another function i think
        // TODO: Fix it
        if (!B4 || !MiMi)
        {
            Debug.LogWarning("WARNING: Cannot find B4 and MiMI on the scene. Destroying Pull of love script.");
            Destroy(gameObject.GetComponent<PullOfLove>());
            return;
        }

        MiMiStatus = MiMi.GetComponent<PlayerController>().playerStatus;
        B4Status = B4.GetComponent<PlayerController>().playerStatus;

        // Makes sure we can't spam the button
        if(B4Status.getBondStatus() && Input.GetButtonDown("B4Pull"))
        {
            float timeDifference = Time.time - startTime;
            if (timeDifference > timeDelay)
            {
                startTime = Time.time;
                PullPlayer(MiMi);
            }
        }

        if (MiMiStatus.getBondStatus() && Input.GetButtonDown("MiMiPull"))
        {
            float timeDifference = Time.time - startTime;
            if (timeDifference > timeDelay)
            {
                startTime = Time.time;
                PullPlayer(B4);
            }
        }
    }
예제 #21
0
    void Awake()
    {
        collider  = GetComponent <CapsuleCollider>();
        rigidbody = GetComponent <Rigidbody>();
        renderer  = GetComponentInChildren <SpriteRenderer>();
        animator  = GetComponentInChildren <Animator>();

        movement = GetComponent <PlayerMovementScript>();
        status   = GetComponent <PlayerStatusScript>();
        ui       = GetComponentInChildren <PlayerUIScript>();

        if (movement != null)
        {
            movement.self = this;
        }
        if (status != null)
        {
            status.self = this;
        }
        if (ui != null)
        {
            ui.self = this;
        }
    }
예제 #22
0
 public void SetPlayer(PlayerStatusScript player)
 {
     this.player = player;
 }
    public void SetVariables()
    {
        rb = GetComponent<Rigidbody>();
        anim = GetComponent<Animator>();
        playerStatus = gameObject.AddComponent<PlayerStatusScript>(); // useful for other scripts

        //B4 = GameObject.FindGameObjectWithTag("B4");
        //MiMi = GameObject.FindGameObjectWithTag("MiMi");
        //B4Status = B4.GetComponent<PlayerController>().playerStatus;
        //MiMiStatus = MiMi.GetComponent<PlayerController>().playerStatus;
    }
    void Start()
    {
        AssignAudioObject();
        B4 = GameObject.FindGameObjectWithTag("B4");
        MiMi = GameObject.FindGameObjectWithTag("MiMi");

        B4Animator = B4.GetComponent<Animator>();
        MiMiAnimator = MiMi.GetComponent<Animator>();

        B4Status = B4.GetComponent<PlayerStatusScript>();
        MiMiStatus = MiMi.GetComponent<PlayerStatusScript>();
        anim = GetComponent<Animator>();
    }
예제 #25
0
 public void SetPlayerStatusScript(PlayerStatusScript playerStatusScript)
 {
     //Debug.Log("SetPlayerStatusScript called, path.Count: "+path.Count);
     this.playerStatusScript = playerStatusScript;
 }
예제 #26
0
    void Start()
    {
        Player = GameObject.Find("Player");
        mPlayerStatusScript = Player.GetComponent <PlayerStatusScript>();
        mExamineScript      = GameObject.Find("ExaminePlane(D)").GetComponent <ExamineScript>();
        mPuzzleTimer        = GameObject.Find("DollPuzzle").GetComponent <PuzzleTimer>();

        mPlayerController = Player.GetComponent <PlayerController>();

        mDefaultRegion[0]  = Region;
        mDefaultRegion[1]  = Region2;
        mDefaultRegion[2]  = Region3;
        mDefaultRegion[3]  = Region4;
        mDefaultRegion[4]  = Region5;
        mDefaultRegion[5]  = Region6;
        mDefaultRegion[6]  = Region7;
        mDefaultRegion[7]  = Region8;
        mDefaultRegion[8]  = Region9;
        mDefaultRegion[9]  = Region10;
        mDefaultRegion[10] = Region11;

        mDefaultPosition[0]  = GameObject.Find("Cube 1").transform.position;
        mDefaultPosition[1]  = GameObject.Find("Cube 2").transform.position;
        mDefaultPosition[2]  = GameObject.Find("Cube 3").transform.position;
        mDefaultPosition[3]  = GameObject.Find("Cube 4").transform.position;
        mDefaultPosition[4]  = GameObject.Find("Cube 5").transform.position;
        mDefaultPosition[5]  = GameObject.Find("Cube 6").transform.position;
        mDefaultPosition[6]  = GameObject.Find("Cube 7").transform.position;
        mDefaultPosition[7]  = GameObject.Find("Cube 8").transform.position;
        mDefaultPosition[8]  = GameObject.Find("Cube 9").transform.position;
        mDefaultPosition[9]  = GameObject.Find("Cube 10").transform.position;
        mDefaultPosition[10] = GameObject.Find("Cube 11").transform.position;
        mDefaultPosition[11] = GameObject.Find("Empty Tile").transform.position;

        mOriginalArray = new int[ROW, COL] {
            { -1, 7, 6, -1 },
            { -1, 3, 10, -1 },
            { 11, 4, 2, 0 },
            { 1, 9, 5, 8 }
        };

        mCurrentArray = new int[ROW, COL] {
            { -1, 7, 6, -1 },
            { -1, 3, 10, -1 },
            { 11, 4, 2, 0 },
            { 1, 9, 5, 8 }
        };

        mActualArray = new int[ROW - 2, COL] {
            { -1, 10, 11, -1 },
            { -1, 8, 9, -1 }
        };

        mActualArray2 = new int[ROW - 2, COL] {
            { -1, 10, 11, -1 },
            { -1, 9, 8, -1 }
        };

        mActualArray3 = new int[ROW - 2, COL] {
            { -1, 11, 10, -1 },
            { -1, 8, 9, -1 }
        };

        mActualArray4 = new int[ROW - 2, COL] {
            { -1, 11, 10, -1 },
            { -1, 9, 8, -1 }
        };

        InputManager.TouchDownEvent += OnTouchDown;
        InputManager.TouchUpEvent   += OnTouchUp;
    }
예제 #27
0
 void Start()
 {
     mExamineScript      = GameObject.Find("/Floor 1/WesternDoor3/GameObject/Plane009/Right").GetComponent <ExamineScript>();
     mPlayerStatusScript = GameObject.Find("Player").GetComponent <PlayerStatusScript>();
     Key = GameObject.Find("Key");
 }
예제 #28
0
    void Start()
    {
        B4 = GameObject.FindGameObjectWithTag("B4");
        MiMi = GameObject.FindGameObjectWithTag("MiMi");

        B4Status = B4.GetComponent<PlayerStatusScript>();
        MiMiStatus = MiMi.GetComponent<PlayerStatusScript>();
    }