コード例 #1
0
    // Use this for initialization
    void Start()
    {
        agent = gameObject.GetComponent <NavMeshAgent>();
        PointHolder.transform.parent = null;
        cone              = Eye.gameObject.GetComponentInChildren <SightCone>();
        cone.sightPoints  = sightPoints;
        stdSpeed          = agent.speed;
        chaseSpeed        = agent.speed * chaseSpeedMultiplier;
        turnSpeed         = agent.speed * turnSpeedMultiplier;
        stdAngularSpeed   = agent.angularSpeed;
        chaseAngularSpeed = stdAngularSpeed * angularSpeedMultiplier;

        PassiveEyeColours = new Color[eyeLights.Length];

        for (int i = 0; i < eyeLights.Length; i++)
        {
            //print(eyeLights[i].color);
            PassiveEyeColours[i] = eyeLights[i].color;
        }
        rend = Eye.GetComponent <Renderer>();
        //print(rend.material);
        passiveEyeMat = rend.material;

        myObjectHandler = gameObject.GetComponent <ObjectInteractions>();

        beeper     = gameObject.GetComponent <AudioSource>();
        initPitch  = beeper.pitch;
        initVolume = beeper.volume;
    }
コード例 #2
0
    public override void VisualizeInteraction(ObjectInteractions action)
    {
        base.VisualizeInteraction(action);
        switch (action)
        {
        case (ObjectInteractions.leave):
            Cursor.text = "o";
            break;

        case (ObjectInteractions.look):
            Cursor.text = "o";
            break;

        case (ObjectInteractions.take):
            Cursor.text = "x";
            break;

        case (ObjectInteractions.use):
            Cursor.text = "^";
            break;

        case (ObjectInteractions.drag):
            Cursor.text = "#";
            break;

        case (ObjectInteractions.UI):
            Cursor.text = "I";
            break;

        default:
            Cursor.text = "+";
            break;
        }
    }
コード例 #3
0
    // Use this for initialization
    void Start()
    {
        interactionController = gameObject.GetComponent <ObjectInteractions>();
        agent         = gameObject.GetComponent <NavMeshAgent>();
        standardSpeed = agent.speed;
        cleaningSpeed = agent.speed * 1.2f;

        movePoints = new Vector3[moveTransforms.Length];
        for (int i = 0; i < moveTransforms.Length; i++)
        {
            movePoints[i] = moveTransforms[i].position;
        }
    }
コード例 #4
0
ファイル: SightCone.cs プロジェクト: ragz88/TeamFireStarter
 // Use this for initialization
 void Start()
 {
     Eye            = transform.parent;
     objInteraction = GameObject.Find("Diego").GetComponent <ObjectInteractions>();
     if (seeker != null)
     {
         loseSightTime = seeker.loseSightTime;
     }
     else
     {
         loseSightTime = golem.loseSightTime;
     }
 }
コード例 #5
0
    // - Start -
    void Start()
    {
        movementScr           = Character.MovementScript;
        gravityBodyScr        = Character.GravityBodyScript;
        objectInteractionsScr = Character.ObjectInteractionsScript;
        collider         = Character.Collider;
        meshRend         = Character.MeshRenderer;
        PLDir            = GetComponent <PlanetLocalDirections>();
        audio            = GetComponent <PlayerAudio>();
        Cursor.lockState = CursorLockMode.Locked;

        // Physics Materials
        movementPhysicMaterial = Resources.Load("PhysicMaterials/PlayerMovementPhysicMat") as PhysicMaterial;
        fallingPhysicMaterial  = Resources.Load("PhysicMaterials/PlayerfallingPhysicMat") as PhysicMaterial;
        spacePhysicMaterial    = Resources.Load("PhysicMaterials/PlayerSpacePhysicMat") as PhysicMaterial;

        // Listeners
        Character.GravityBodyScript.SpaceEntered += OnSpaceEntered;
        Character.GravityBodyScript.SpaceLeaved  += OnSpaceLeaved;
    }
コード例 #6
0
    // - Init -
    public static void CharacterInit(GameObject player, GameObject characterHud)
    {
        // Data
        name = "Metu";
        mass = 7;

        // Parts
        gameObject   = player;
        transform    = gameObject.transform;
        rb           = gameObject.GetComponent <Rigidbody>();
        collider     = gameObject.GetComponent <Collider>();
        meshRenderer = gameObject.GetComponent <MeshRenderer>();
        cameras      = transform.Find("Cameras").gameObject;
        pippeli      = transform.Find("UrineParticleSys").gameObject;
        characterHUD = characterHud;

        // Scripts
        playerControllerScr   = gameObject.GetComponent <PlayerController>();
        movementScr           = gameObject.GetComponent <Movement>();
        gravityBodyScr        = gameObject.GetComponent <GravityBody>();
        planetLocalDirections = gameObject.GetComponent <PlanetLocalDirections>();
        objectInteractionsScr = gameObject.GetComponent <ObjectInteractions>();
    }
コード例 #7
0
 public void SetInteractionIndicators(ObjectInteractions type)
 {
     InteractionVisualizer.VisualizeInteraction(type);
 }
コード例 #8
0
ファイル: Monster.cs プロジェクト: shalo1040/MovingMoving
    //사용자가 이겼을 때
    void Win()
    {
        Destroy(Bar);
        Singleton.Instance.done = true;     //Player.cs에 게임이 끝났음을 알려줌
        //Time.timeScale = 0;
        //경험치 증가
        Singleton.Instance.exp += 100;

        //도감 추가
        StartCoroutine(InsertMonster(monsterName));

        //구슬 추가
        ObjectInteractions obj = new ObjectInteractions();
        int marble1 = 0, marble2 = 0, marble3 = 0;
        int randomCount;

        switch (Singleton.Instance.level)
        {
        case 1:
            randomCount = 3;
            break;

        case 2:
            randomCount = 5;
            break;

        case 3:
            randomCount = 6;
            break;

        default:
            randomCount = 7;
            break;
        }
        for (int i = 0; i < randomCount; i++)     //구슬 n개 랜덤으로 뽑음
        {
            switch (obj.GetRandomValue())
            {
            case 1:
                marble1++;
                break;

            case 2:
                marble2++;
                break;

            case 3:
                marble3++;
                break;
            }
        }
        StartCoroutine(IncMarbleCount(marble1, marble2, marble3));

        winResultImg.sprite = winImg;
        winResultImg.rectTransform.localPosition = new Vector3(0, 247, 0);
        winResultImg.rectTransform.localScale    = new Vector3(12.136f, 12.136f, 12.136f);

        result.rectTransform.localPosition = new Vector3(330f, 356f, 0f);

        result.text += "경험치 " + 100;
        if (marble1 != 0)
        {
            result.text += "\n레벨1 구슬 " + marble1 + " 개";
        }
        if (marble2 != 0)
        {
            result.text += "\n레벨2 구슬 " + marble2 + " 개";
        }
        if (marble3 != 0)
        {
            result.text += "\n레벨3 구슬 " + marble3 + " 개";
        }

        resultWindow_monster.SetActive(true);           //결과창
    }
コード例 #9
0
 public virtual void VisualizeInteraction(ObjectInteractions action)
 {
 }
コード例 #10
0
 public void Awake()
 {
     scriptTarget = (ObjectInteractions)target;
 }
コード例 #11
0
ファイル: CanvasObject.cs プロジェクト: xyfc/PrimitiveCanvas
 /// <summary>
 /// Returns true if the given interaction is enabled by the
 /// object.
 /// </summary>
 /// <param name="interaction"></param>
 /// <returns></returns>
 public bool Is(ObjectInteractions interaction)
 {
     return((this.Interactions & interaction) != 0);
 }