private void LemmingDie(LemmingStateController lemming) { if (isServer) { RpcLemmingDie(lemming.GetComponent <NetworkIdentity>()); } }
//Assign Skills public bool assignSkill(LemmingStateController lemming) { if (skillsCounter[selectedSkill] <= 0) { return(false); } if (selectedSkill == Skill.Blocker) { blockerSelector.AttachToSomeone(lemming); isWaitingForBlockerConfirmation = true; return(false); } var localNetworkPlayer = LNetworkPlayer.LocalInstance; if (localNetworkPlayer == null) { Debug.LogError("no netowrk player"); return(false); } localNetworkPlayer.CmdGiveSkill(lemming.GetComponent <NetworkIdentity>(), selectedSkill, lemming.transform.position); /* todo: give skill used to return false when trying to give skills and failed. * With networked game, we need to change it to create skill given and skill failed events. */ skillsCounter[selectedSkill]--; selectedSkill = Skill.None; GameEvents.Lemmings.LemmingUsedSkill.SafeInvoke(lemming); return(true); }
private void LemmingExit(LemmingStateController lemming) { Debug.Log("triggered local lemming exit"); if (isServer) { Debug.Log("server triggered local lemming exit"); RpcLemmingExit(lemming.GetComponent <NetworkIdentity>()); } }