public static AssignHumanoidReferences ( |
||
references | ||
animator | ||
autoDetectParams | AutoDetectParams | |
Résultat | void |
public static bool AutoDetectReferences(ref BipedReferences references, Transform root, BipedReferences.AutoDetectParams autoDetectParams) { if (references == null) { references = new BipedReferences(); } references.root = root; Animator component = root.GetComponent <Animator>(); if (component != null && component.isHuman) { BipedReferences.AssignHumanoidReferences(ref references, component, autoDetectParams); return(true); } BipedReferences.DetectReferencesByNaming(ref references, root, autoDetectParams); Warning.logged = false; if (!references.isFilled) { Warning.Log("BipedReferences contains one or more missing Transforms.", root, true); return(false); } string message = ""; if (BipedReferences.SetupError(references, ref message)) { Warning.Log(message, references.root, true); return(false); } if (BipedReferences.SetupWarning(references, ref message)) { Warning.Log(message, references.root, true); } return(true); }
public static bool AutoDetectReferences(ref BipedReferences references, Transform root, BipedReferences.AutoDetectParams autoDetectParams) { if (references == null) { references = new BipedReferences(); } references.root = root; BipedReferences.DetectReferencesByNaming(ref references, root, autoDetectParams); if (references.isValid && BipedReferences.CheckSetupError(references, false) && BipedReferences.CheckSetupWarning(references, false)) { return(true); } BipedReferences.AssignHumanoidReferences(ref references, root.GetComponent <Animator>(), autoDetectParams); bool isValid = references.isValid; if (!isValid) { Warning.Log("BipedReferences contains one or more missing Transforms.", root, true); } return(isValid); }