Example #1
0
    void Start()
    {
        _selfTransform   = GetComponent <Transform>();
        _move            = GetComponent <MoveToPoints>();
        _selfLifeHandler = GetComponent <LifeHandler>();

        _selfLifeHandler.FillingHandler(Life, 0, GetComponent <CapsuleCollider2D>());
    }
Example #2
0
    void StartMovingPlatform(float startingTime)
    {
        if (Network.isServer)
        {
            networkView.RPC("StartMovingPlatform", RPCMode.OthersBuffered, startingTime);
        }

        GameObject[] lifts = GameObject.FindGameObjectsWithTag("MovingPlatform");

        foreach (GameObject tempLift in lifts)
        {
            MoveToPoints tempComponent = tempLift.GetComponent <MoveToPoints>();
            //tempComponent.SetPositionByTime(startingTime);
            tempComponent.moveEnabled = true;
        }

        isMovingPlatformStarted = true;
    }
Example #3
0
    private void OnSceneGUI()
    {
        MoveToPoints moveToPoints    = target as MoveToPoints;
        Transform    handleTransform = moveToPoints.transform;
        Quaternion   handleRotation  = handleTransform.rotation;

        Handles.color = Color.white;

        for (int i = 0; i < path.arraySize; i++)
        {
            Vector3 point = path.GetArrayElementAtIndex(i).vector3Value;

            EditorGUI.BeginChangeCheck();
            Vector3 handlePos = Handles.DoPositionHandle(point, handleRotation);
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(moveToPoints, "Move Array Point");
                EditorUtility.SetDirty(moveToPoints);
                moveToPoints.SetPointElement(i, handlePos);
            }
        }
    }