private void Start() { if (gameEndPanel != null) { gameEndPanel.SetActive(false); } myTimer = GetComponent <ControllerBehaviour>(); }
/** * Attaches the plane to the controller's position and shows it */ public void Show(ControllerBehaviour controller) { transform.position = controller.transform.position; transform.rotation = controller.transform.rotation; transform.parent = controller.transform; transform.localPosition += new Vector3(0, 0, 1.05f); gameObject.SetActive(true); }
public void Start() { playerStats = GetComponentInParent <PlayerGameplayValues>(); controllerBehaviour = transform.parent.GetComponent <ControllerBehaviour>(); healthBehaviour = transform.parent.GetComponent <HealthBehaviour>(); bowController = transform.parent.GetComponent <BowController>(); }
void Start() { listReference = GameObject.FindGameObjectWithTag("Spawner").GetComponent <ControllerBehaviour>(); myRend = GetComponent <MeshRenderer>(); SetPlayerColor(); curLives = maxLives; myRB = GetComponent <Rigidbody>(); }
void Start() { shipListController = GetComponent <ControllerBehaviour>(); playerConnect = new bool[4]; for (int i = 0; i < playerConnect.Length; i++) { playerConnect[i] = false; } }
/// <summary> /// Facebook player basic infos callback. Being the first login is added to coins the gift for logged in. /// At last is call the ScoreAndKDCallback callback. /// </summary> /// <param name="result">Result.</param> void PlayerInfoCallback(IResult result) { if (result.Error != null) { _facebookPlayersObserver.OnError(); } else { string id = result.ResultDictionary["id"].ToString(); string name = result.ResultDictionary["name"].ToString(); int highscore = 0; Coins coins = LoadCoins(); if (result.ResultDictionary.ContainsKey("scores")) { IDictionary <string, object> data = (IDictionary <string, object>)result.ResultDictionary ["scores"]; List <object> listObj = (List <object>)data ["data"]; foreach (object obj in listObj) { var entry = (Dictionary <string, object>)obj; if (entry ["score"] != null) { highscore = Int32.Parse(entry ["score"].ToString()); } break; } } else { coins.SetFacebookGift(); } if (_localPlayer._highScore > highscore) { highscore = _localPlayer._highScore; SaveNewHighScore(highscore); } _localPlayer = new Player(id, name, highscore, coins); //Notifies the server that the player has changed id foreach (GameObject obj in GameObject.FindGameObjectsWithTag("Player")) { ControllerBehaviour player = obj.GetComponent <ControllerBehaviour> (); if (player.isLocalPlayer) { player.ChangedId(); break; } } FB.API("/app/scores?fields=score,user.limit(30)", HttpMethod.GET, ScoreAndKDCallback); } }
public void Start() { playerStats = GetComponent <PlayerGameplayValues>(); timeBetweenShots = data.timeBetweenShots; controllerBehaviour = GetComponent <ControllerBehaviour>(); StartCoroutine(GiveArrows()); }
/** * Begin interaction with a controller */ public void OnBeginInteraction(ControllerBehaviour controller) { // Save reference to controller attachedController = controller; // Follow controller's position and orientation this.transform.parent = controller.transform; interacting = true; }
public void OnTriggerEnter(Collider other) { if (other.GetComponent <PlayerGameplayValues>() != null) { playerIn = true; playerValues = other.GetComponent <PlayerGameplayValues>(); playerController = other.GetComponent <ControllerBehaviour>(); //player is buying } }
/** * End interaction with a controller */ public void OnEndInteraction(ControllerBehaviour controller) { // React only if it's the controller the object is following if (controller == attachedController) { // Delete reference and unparent attachedController = null; this.transform.parent = null; interacting = false; } }
/// <summary> /// Method to add a new player. This method must be call on server-side context /// </summary> public void AddPlayer(string playerId, ControllerBehaviour player) { if (players.ContainsKey(playerId)) { players [playerId] = player; } else { players.Add(playerId, player); } }
protected void SetTarget(params object[] args) { if (args[0] == null) { target = null; } else { target = (ControllerBehaviour)args[0]; ListenTo(target, Channel.GameObject.Destroy, _ => target = null); } }
void Start() { // Initializing the controller component: controller = GetComponent <ControllerBehaviour>(); gravity = -(2 * jumpHeight) / Mathf.Pow(timeToJumpApex, 2); // setting the gravity value jumpVelocity = Mathf.Abs((gravity * timeToJumpApex)); // setting the jump velocity playerRenderer = GetComponent <SpriteRenderer>(); animator = GetComponent <Animator>(); if (controller != null) { controller.Init(); } }
public void Start() { bowController = GetComponent <BowController>(); controllerBehaviour = GetComponent <ControllerBehaviour>(); //if premiere partie et jamais joué avant print(scriptableStats); maxHealth = scriptableStats.maxHealth.startValue; healthRegen = scriptableStats.healthRegen.startValue; speed = scriptableStats.speed.startValue; magazineSize = scriptableStats.maxAmmo.startValue; numberOfArrowStartingGame = scriptableStats.startAmmo.startValue; maxStamina = scriptableStats.maxStamina.startValue; staminaRegen = scriptableStats.staminaRegen.startValue; health = maxHealth; stamina = maxStamina; }
/** * Called at object's initialization */ void Awake() { // Register self to globals Globals.controllers = this; // Save references manager = gameObject.GetComponent <VRTK_SDKManager>(); leftController = manager.scriptAliasLeftController; rightController = manager.scriptAliasRightController; leftBehaviour = leftController.GetComponent <ControllerBehaviour>(); rightBehaviour = rightController.GetComponent <ControllerBehaviour>(); // Register callback to ParaView Object Loaded event Globals.ParaviewObjectLoadedCallbacks += OnParaviewObjectLoaded; Globals.ParaviewObjectUnloadedCallbacks += OnParaviewObjectUnloaded; }
/// <summary> /// Bullet collider. /// </summary> /// <param name="collision">Object wich bullet collided.</param> void OnCollisionEnter(Collision collision) { StopAllCoroutines(); CmdDestroy(); //Just the server has a list with all players id. //This id must be use to identify player and send his points. if (!isServer) { return; } Destructible obj = collision.gameObject.GetComponent <Destructible> (); if (obj != null) { ControllerBehaviour player = PlayersManager.instance.GetPlayerById(_id); player._score += obj.GetPoints(); } }
protected virtual bool OnMeetObtacle(ControllerBehaviour obj, CellController lastCell) { return(true); }
public void LoadScene(AssetReference scene) => ControllerBehaviour.LoadScene(scene);
/** * Attaches the slicing plan to a controller and shows it */ public void ShowPlane() { ControllerBehaviour controller = Globals.controllers.getNonRadialController(); plane.Show(controller); }
/** * Called at object's initialization */ protected override void Awake() { base.Awake(); behaviour = GetComponent <ControllerBehaviour>(); radialMenu = transform.FindDeepChild("RadialMenuUI/Panel").GetComponent <VRTK_RadialMenu>(); }
protected override bool OnMeetObtacle(ControllerBehaviour obj, CellController lastCell) { console.log("meet", obj.GetType()); return(true); }
void Awake() { controller = GetComponent <ControllerBehaviour>(); }
public void Start() { playerStats = GetComponent <PlayerGameplayValues>(); controllerBehaviour = GetComponent <ControllerBehaviour>(); }
void Awake() { controller = GetComponent<ControllerBehaviour>(); }
public void OnTriggerExit(Collider other) { playerIn = false; playerValues = null; playerController = null; }
public ControllerBehaviour(ControllerBehaviour newBehaviour) { this = newBehaviour; }